#pragma once

#include <cstring>
#include <iostream>
using namespace std;
#include "IndexOutOfBoundsException.h"

template<class E>
class ArrayList
{

	template<class E>
	friend ostream& operator<< (ostream&, ArrayList<E>&);


public:
	ArrayList();
	ArrayList(const int&);
	~ArrayList();

	virtual void add(const E&);
	void add(const E&, const int&);
	void remove(const int&);
	E& operator[] (const int&);

	E* getArray() const;
	int getSize() const;

protected:
	E* arrayPointer;
	int size;
	int capacity;
	const int DEFAULT_CAPACITY = 16;
};
